<template>
    <el-carousel :interval="4000" type="card" height="300px">
      <el-carousel-item v-for="item in 4" :key="item">
        <!-- 图片展示部分 -->
        <img :src="`/${item}.png`" alt="carousel image" class="carousel-image" />
      </el-carousel-item>
    </el-carousel>
  </template>
  
  <style scoped>
  .el-carousel__item {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 确保图片自适应区域且不变形 */
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n + 1) {
    background-color: #d3dce6;
  }
  </style>